package top.kikt.book

import org.yaml.snakeyaml.Yaml
import top.kikt.book.core.BookCatcher
import top.kikt.book.core.config.BookConfig
import java.io.FileInputStream
import kotlin.system.exitProcess

class App {

    companion object {

        @JvmStatic
        fun main(args: Array<String>) {
            val yaml = Yaml()

            val config = yaml.loadAs(FileInputStream("config.yaml"), BookConfig::class.java)
            val appConfig = config.app

            val bookCatcher = BookCatcher(appConfig)
            bookCatcher.catchBook()

            exitProcess(0)
        }

    }
}